/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.onlinevillage;

import org.onlinevillage.Gbencode;

Integer five = 5
def bFive = "i5e"
def bStringDict = "d9:publisher3:bob17:publisher-webpage15:www.example.com18:publisher.location4:homee"
def stringDict = ["publisher":"bob", "publisher-webpage":"www.example.com", "publisher.location":"home"]
def moreComplex = ["spam":["a", "b"] ]
def bMoreComplex = "d4:spaml1:a1:bee"

ExpandoMetaClass.enableGlobally()
Gbencode.modifyMetaClasses()

assert stringDict.bencode() == bStringDict
assert bStringDict.bdecode() == stringDict
assert moreComplex.bencode() == bMoreComplex
assert bMoreComplex.bdecode() == moreComplex


